package _SED.client;

import java.util.Date;
import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("greet")
public interface DBConnection extends RemoteService {
	//Users
	public String[] userAuth(String name, String pwd) throws IllegalArgumentException;
	
	public String userCreate(String usr, String lname, String fname, String role, String pwd) throws IllegalArgumentException;
	
	public String userChange(String usr, String lname, String fname, String role, String pwd) throws IllegalArgumentException;
	
	public String userDelete(String usr) throws IllegalArgumentException;
		
	public String[] getUsers() throws IllegalArgumentException;
	public String[] getCI() throws IllegalArgumentException;
	public String[] getCA() throws IllegalArgumentException;
	public String[] getCO() throws IllegalArgumentException;
	public String[] getCD() throws IllegalArgumentException;
		
	public String[] getUser(String usr) throws IllegalArgumentException;
	
	// RFC
	public long getNextRfcNr() throws IllegalArgumentException;
	public List<Rfc> fetchRfc(int start, int length);
	
	public String createRFC(long id, String reason, String desc, String detaildesc,Date validFrom, String CI, String CO,
			   String CA, String prio, String cost, String benefit, String risk, String service, String cItems ) throws IllegalArgumentException;
	
	public String changeRfc(long id, String reason, String desc, String detaildesc,Date validFrom, Date approvedOn, Date solvedOn, Date closedOn, Date startedOn, String CI, String CO, 
		   String CA, String CD, String prio, String cost, String benefit, String risk, String service, String cItems, String state ) throws IllegalArgumentException;
	
	public String deleteAllRfcs() throws IllegalArgumentException;
	
	
	// WO
	public List<WO> fetchWO(int start, int length);
	
	public WO getWO(long id);
	
	public String createWO(long id, Date planedStart, String CD, String CO,  String woType,String desc, String serv, String cItem) throws IllegalArgumentException;
	
	public String changeWO(long id, Date planedStart, Date planedEnd, Date actStart, Date actEnd,
			String planedEffort, String CD, String CO, String woType, String desc, String serv, String cItem, String state)
			throws IllegalArgumentException;
	
}
